package com.xyy.yueshijia.view.store;

import android.content.Context;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.superrecycleview.superlibrary.adapter.BaseViewHolder;
import com.superrecycleview.superlibrary.adapter.SuperBaseAdapter;
import com.xyy.yueshijia.R;
import com.xyy.yueshijia.bean.shop.StoreDatas;
import com.xyy.yueshijia.utils.ImageLoader;

import java.util.List;

/**
 * Created by lxs on 2017/2/13.
 */

public class SpecialHeadViewHolder  {
    private Context mContext;
    private StoreDatas mStoreDatas;
    private final View mHeadView;
    private TextView mTextView;
    private ImageView mImageView;

    public View getmHeadView() {
        return mHeadView;
    }

    public SpecialHeadViewHolder(Context context, ViewGroup viewGroup, StoreDatas data) {
        this.mContext = context;
        this.mStoreDatas = data;
        this.mHeadView = LayoutInflater.from(mContext).inflate(R.layout.item_special_head_view, viewGroup, false);
        init();
    }

    public void init(){
        mTextView = (TextView) mHeadView.findViewById(R.id.text_special_head);
        mTextView.setText(mStoreDatas.getSpecial_stitle());
        mImageView = (ImageView) mHeadView.findViewById(R.id.image_special_head);
        ImageLoader.getSingleton().displayImage(mContext,mStoreDatas.getSpecial_image(),mImageView);
    }
//    @Override
//    protected void convert(BaseViewHolder holder, StoreDatas item, int position) {
//            holder.setText(R.id.text_special_head,item.getSpecial_stitle());
//        ImageLoader.getSingleton().displayImage(mContext
//                ,item.getSpecial_image()
//                ,(ImageView)holder.getView(R.id.image_special_head));
//    }

//    @Override
//    protected int getItemViewLayoutId(int position, StoreDatas item) {
//        return R.layout.item_special_head_view;
//    }
}
